//
//  ColumnView.m
//  NBANews
//
//  Created by Liccon Chang on 11-1-10.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "ColumnView.h"


@implementation ColumnView

@synthesize leftgap,gap;

- (id)initWithFrame:(CGRect)frame {
    if ((self = [super initWithFrame:frame])) {
        leftgap = 5;
		gap = 5;
    }
    return self;
}


-(void) layoutSubviews{
	int x = leftgap;
	CGRect viewFrame;
	for (UIView* view in [self subviews]) {
		viewFrame = view.frame;
		viewFrame.origin.x = x;
		view.frame = viewFrame;
		x += viewFrame.size.width;
		x += gap;
	}
	[self setContentSize:CGSizeMake(x, self.frame.size.height)];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)dealloc {
    [super dealloc];
}


@end
